package com.qms.repast.service;


import com.qms.repast.entity.resbean.BannerBean;
import com.qms.repast.entity.resbean.CityBean;

import java.util.concurrent.TimeUnit;

import io.reactivex.Observable;
import io.rx_cache2.EvictProvider;
import io.rx_cache2.LifeCache;
import io.rx_cache2.ProviderKey;

/**
 * @author 泅渡者
 * @date 2018/6/6 0006.
 * @describe:
 */

public interface CacheProviders {

	/**
	 * 加载数据 30天缓存期限
	 *
	 * @param result
	 * @param evictProvider 是否清楚数据
	 *
	 * @return
	 */
	@ProviderKey("cache_city")
	@LifeCache(duration = 30, timeUnit = TimeUnit.DAYS)
	Observable<CityBean> getCacheCityList (Observable<CityBean> result, EvictProvider evictProvider);

	/**
	 * 轮播图数据缓存7天
	 *
	 * @param result
	 * @param evictProvider
	 *
	 * @return
	 */
	@ProviderKey("cache_banner")
	@LifeCache(duration = 7, timeUnit = TimeUnit.DAYS)
	Observable<BannerBean> getCacheBannerList (Observable<BannerBean> result, EvictProvider evictProvider);
}
